package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the OPENTICKETRECORD database table.
 * 
 */
@Entity
@NamedQuery(name="Openticketrecord.findAll", query="SELECT o FROM Openticketrecord o")
public class Openticketrecord implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="OPENTICKETRECORD_OTRID_GENERATOR", sequenceName="SEQ_28")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="OPENTICKETRECORD_OTRID_GENERATOR")
	@Column(name="OTR_ID")
	private long otrId;

	@Column(name="OTR_CO_ID")
	private BigDecimal otrCoId;

	@Column(name="OTR_CO_NAME")
	private String otrCoName;

	@Column(name="OTR_CONTENT")
	private String otrContent;

	@Column(name="OTR_CUS_ID")
	private BigDecimal otrCusId;

	@Column(name="OTR_CUS_NAME")
	private String otrCusName;

	@Column(name="OTR_IF_BACK")
	private String otrIfBack;

	@Column(name="OTR_MAN")
	private String otrMan;

	@Column(name="OTR_MONEY")
	private BigDecimal otrMoney;

	@Column(name="OTR_PERIOD")
	private BigDecimal otrPeriod;

	@Column(name="OTR_REMARKS")
	private String otrRemarks;

	@Temporal(TemporalType.DATE)
	@Column(name="OTR_TIME")
	private Date otrTime;

	@Column(name="OTR_TYPE")
	private String otrType;

	//bi-directional many-to-one association to ConstactOrder
	@OneToMany(mappedBy="openticketrecord")
	private List<ConstactOrder> constactOrders;

	//bi-directional many-to-one association to ConstactOrder
	@ManyToOne
	@JoinColumn(name="CO_ID")
	private ConstactOrder constactOrder;

	//bi-directional many-to-one association to Customerinfo
	@ManyToOne
	@JoinColumn(name="CUST_ID")
	private Customerinfo customerinfo;

	public Openticketrecord() {
	}

	public long getOtrId() {
		return this.otrId;
	}

	public void setOtrId(long otrId) {
		this.otrId = otrId;
	}

	public BigDecimal getOtrCoId() {
		return this.otrCoId;
	}

	public void setOtrCoId(BigDecimal otrCoId) {
		this.otrCoId = otrCoId;
	}

	public String getOtrCoName() {
		return this.otrCoName;
	}

	public void setOtrCoName(String otrCoName) {
		this.otrCoName = otrCoName;
	}

	public String getOtrContent() {
		return this.otrContent;
	}

	public void setOtrContent(String otrContent) {
		this.otrContent = otrContent;
	}

	public BigDecimal getOtrCusId() {
		return this.otrCusId;
	}

	public void setOtrCusId(BigDecimal otrCusId) {
		this.otrCusId = otrCusId;
	}

	public String getOtrCusName() {
		return this.otrCusName;
	}

	public void setOtrCusName(String otrCusName) {
		this.otrCusName = otrCusName;
	}

	public String getOtrIfBack() {
		return this.otrIfBack;
	}

	public void setOtrIfBack(String otrIfBack) {
		this.otrIfBack = otrIfBack;
	}

	public String getOtrMan() {
		return this.otrMan;
	}

	public void setOtrMan(String otrMan) {
		this.otrMan = otrMan;
	}

	public BigDecimal getOtrMoney() {
		return this.otrMoney;
	}

	public void setOtrMoney(BigDecimal otrMoney) {
		this.otrMoney = otrMoney;
	}

	public BigDecimal getOtrPeriod() {
		return this.otrPeriod;
	}

	public void setOtrPeriod(BigDecimal otrPeriod) {
		this.otrPeriod = otrPeriod;
	}

	public String getOtrRemarks() {
		return this.otrRemarks;
	}

	public void setOtrRemarks(String otrRemarks) {
		this.otrRemarks = otrRemarks;
	}

	public Date getOtrTime() {
		return this.otrTime;
	}

	public void setOtrTime(Date otrTime) {
		this.otrTime = otrTime;
	}

	public String getOtrType() {
		return this.otrType;
	}

	public void setOtrType(String otrType) {
		this.otrType = otrType;
	}

	public List<ConstactOrder> getConstactOrders() {
		return this.constactOrders;
	}

	public void setConstactOrders(List<ConstactOrder> constactOrders) {
		this.constactOrders = constactOrders;
	}

	public ConstactOrder addConstactOrder(ConstactOrder constactOrder) {
		getConstactOrders().add(constactOrder);
		constactOrder.setOpenticketrecord(this);

		return constactOrder;
	}

	public ConstactOrder removeConstactOrder(ConstactOrder constactOrder) {
		getConstactOrders().remove(constactOrder);
		constactOrder.setOpenticketrecord(null);

		return constactOrder;
	}

	public ConstactOrder getConstactOrder() {
		return this.constactOrder;
	}

	public void setConstactOrder(ConstactOrder constactOrder) {
		this.constactOrder = constactOrder;
	}

	public Customerinfo getCustomerinfo() {
		return this.customerinfo;
	}

	public void setCustomerinfo(Customerinfo customerinfo) {
		this.customerinfo = customerinfo;
	}

}